﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BankAccount
{
    class BankAccount
    {
        int accountNumber;
        String clientName;
        decimal balance;

        public void setName(String newName)
        {
            this.clientName = newName;
        }

        public BankAccount(int accountNumber, String clientName, decimal balance)
              {
                   Account= accountNumber;
                   Name = clientName;
                   Balance = balance;
            

               }
        
        public int Account {get; set;}

        public String Name
        {
            get
            {
                return this.clientName;
            }
            set
            {
                this.clientName = value;
                ;
            }
        }
       
            
         public decimal Balance{get; set;}

        public void deposit(int addMoney)
        {
            this.Balance = this.Balance + addMoney;
        }
        public void withdraw(int takeMoney)
        {
            if (this.Balance>=takeMoney)
            {
                this.Balance=this.Balance-takeMoney;
            }
                else {this.Balance=this.Balance;}
            

            }
        public String AsAString()
        {
            String holder;
            holder = "This is account number " + Account + " the owner of this account is " + Name + " and the current balance is " + Balance;
            return holder;
        }
        }
    }

